<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
option explicit
dim rs2,consulta
Response.Expires = -1000
Response.ExpiresAbsolute = 0
Response.Buffer = true
Response.ContentType = "image/gif"
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
%>
<!-- #include file="includes/conn.asp" -->
<%
	set rs2 = server.createObject("adodb.recordset")
	consulta ="select imagem from materiais where id="&request.querystring("cod")&" order by id"
	rs2.open consulta,conn
	if isnull(rs2("imagem")) then
%>
		<img src="imagens\semimagem.gif">
<%
	else
		'Response.ContentType = "image/jpeg/gif/jpg"
		Response.BinaryWrite rs2("imagem")
	end if

	rs2.close
	conn.close
	set rs2 = nothing
	set Conn = nothing
	Response.End
%>